package top.codestudy.wanandroid.ui;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import top.codestudy.wanandroid.R;
import top.codestudy.wanandroid.uimanager.TopBarManager;
import top.codestudy.wanandroid.widget.RotateAnimationButton;

public class MainActivity extends BaseActivity implements View.OnClickListener {
    private String TAG = getClass().getSimpleName();
    private Context context;
    /**
     * 播放
     */
    private Button mBtnStart;
    private RotateAnimationButton mRabCc;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();


    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_main;
    }

    private void initView() {
        initTopBar();

        mBtnStart = (Button) findViewById(R.id.btn_start);
        mBtnStart.setOnClickListener(this);

    }

    private void initTopBar() {
        Drawable ivLeftDrawable = getResources().getDrawable(R.drawable.ic_action_menu, null);
        Drawable ivLeftDrawable2 = getResources().getDrawable(R.drawable.ic_action_left_arrow, null);
        Drawable ivRightConvenientDrawable = getResources().getDrawable(R.drawable.ic_action_hot, null);
        Drawable ivRightDrawable = getResources().getDrawable(R.drawable.ic_action_search, null);
        TopBarManager topBarManager = new TopBarManager(getWindow());
        topBarManager.ivLeft.setImageDrawable(ivLeftDrawable);
        topBarManager.tvLeft.setText("玩Android");
        topBarManager.tvLeft.setTextColor(Color.WHITE);
        topBarManager.tvLeft.setTypeface(Typeface.create((String) null, Typeface.BOLD));
        topBarManager.ivRightConvenient.setImageDrawable(ivRightConvenientDrawable);
        topBarManager.ivRight.setImageDrawable(ivRightDrawable);
    }

    @Override
    public void onClick(View v) {
        Log.i(TAG, "onClick:     ");
    }
}
